import Vue from 'vue';
import Router from 'vue-router';
import Home from '@/views/Home.vue';
import AddUser from '@/views/users/adduser.vue';
import UserList from '@/views/users/userlist.vue';
import AddOrder from '@/views/orders/addorder.vue';
import OrderList from '@/views/orders/orderlist.vue';
import OrderDetail from '@/views/orders/orderdetail.vue';
import AddProduct from '@/views/products/addproduct.vue';
import ProductList from '@/views/products/productlist.vue';
import Export from '@/views/data/export.vue';
import Import from '@/views/data/import.vue';
import Ftp from '@/views/data/ftp.vue';

Vue.use(Router);

export default new Router({
	mode: 'history',
	routes: [
		{
			path: '*',
			redirect: '/' // 如果找不到输入的页面就转入404
		},
		{
			path: '/',
			name: 'Home',
			component: Home
		},
		{
			path: '/user/add',
			name: 'AddUser',
			component: AddUser
		},
		{
			path: '/user/?id',
			name: 'ModifyUser',
			component: AddUser
		},
		{
			path: '/user/detail/?id',
			name: 'UserDetail',
			component: AddUser
		},
		{
			path: '/user/list',
			name: 'UserList',
			component: UserList
		},
		{
			path: '/order/add',
			name: 'AddOrder',
			component: AddOrder
		},
		{
			path: '/order/detail/?id',
			name: 'OrderDetail',
			component: OrderDetail
		},
		{
			path: '/order/list',
			name: 'OrderList',
			component: OrderList
		},
		{
			path: '/product/add',
			name: 'AddProduct',
			component: AddProduct
		},
		{
			path: '/product/?id',
			name: 'ModifyProduct',
			component: AddProduct
		},
		{
			path: '/productd/detail/?id',
			name: 'ProductDetail',
			component: AddProduct
		},
		{
			path: '/product/list',
			name: 'ProductList',
			component: ProductList
		},
		{
			path: '/data/export',
			name: 'ExportData',
			component: Export
		},
		{
			path: '/data/import',
			name: 'ImportData',
			component: Import
		},
		{
			path: '/data/ftp',
			name: 'Ftp',
			component: Ftp
		}
	]
});
